import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'
import SearchView from '../views/SearchView.vue'
import Searchlist from '../views/Searchlist.vue'
import User from '../views/User.vue'
import Cs from '../views/cs.vue'
import Yuedu from '../views/yuedu.vue'
import Mulu from '../views/mululist.vue'
import Modo from '../views/modo.vue'
import Modoph from '../views/modoph.vue'
import Pl from '../views/pl.vue'
import Fl from '../views/fl.vue'
import Load from '../views/load.vue'
import Shelf from '../views/shelf.vue'
import Cookic from '../views/cookic.vue'
import BookView from '../views/BookView.vue'
import Home from '../components/homexq/homelist'
Vue.use(VueRouter)
const routes = [
  {
    path: '/',
    redirect: '/home',
  },
  {
    path: '/home',
    name: 'home',
    component: HomeView,
  },
  {
    path: '/book',
    name: 'book',
    component: BookView,
    children: [
      {
        path: 'nvplist',
        component: () => import('@/components/booklist/nvblist.vue')
      },
      {
        path: 'cblist',
        component: () => import('@/components/booklist/cblist.vue')
      },
      {
        path: 'fllist',
        component: () => import('@/components/booklist/fllist.vue')
      },
      {
        path: 'mflist',
        component: () => import('@/components/booklist/mflist.vue')
      },
      {
        path: 'phlist',
        component: () => import('@/components/booklist/phlist.vue')
      },
      {
        path: 'home',
        component: Home,
      },
      {
        path: 'load',
        component: Load,
      },
    ]
  },
  {
    path: '/search',
    name: 'search',
    component: SearchView,
  },
  {
    path: '/searchlist',
    name: 'searchlist',
    component: Searchlist,
  },
  {
    path: '/user',
    name: 'user',
    component: User,
  },
  {
    path: '/register',
    name:'register',
    component: () => import('@/components/user/register.vue')
  },
  {
    path: '/login',
    name:'login',
    component: () => import('@/components/user/login.vue')
  },
  {
    path: '/cs',
    name: 'cs',
    component: Cs,
  },
  {
    path: '/yuedu',
    name: 'yuedu',
    component: Yuedu,
  },
  {
    path: '/mulu',
    name: 'mulu',
    component: Mulu,
  },
  {
    path: '/modo',
    name: 'modo',
    component: Modo,
  },
  {
    path: '/modoph',
    name: 'modoph',
    component: Modoph,
  },
  {
    path: '/pl',
    name: 'pl',
    component: Pl,
  },
  {
    path: '/shelf',
    name: 'shelf',
    component: Shelf,
  },
  {
    path: '/cookic',
    name: 'cookic',
    component: Cookic,
  },

  {
    path: '/fl',
    name: 'fl',
    component: Fl,
    children: [
      {
        path: 'fls',
        component: () => import('@/components/fllist/fls.vue')
      },
    ]
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router

